Skip to content

Reject top-k queries with k greater than the number of indexed series - #83

Merged
FrancescaDelGaudio merged 3 commits into
mainfrom
fix/topk-k-greater-than-n
Nov 11, 2026
Merged

FrancescaDelGaudio merged 3 commits into
mainfrom
fix/topk-k-greater-than-n

Conversation

@FrancescaDelGaudio

Copy link
Copy Markdown
Collaborator

Messi, Sofa, Fresh and Sing padded missing top-k slots by repeating the last neighbor; ParIS, Coconut and Hercules returned placeholder ids; and BruteForce, LbBruteforce, DumpyOS and Odyssey only printed an error and returned without writing results.

Add SimilaritySearchAlgorithm::checkTopKNotGreaterThanDatabase, which throws std::invalid_argument (ValueError in Python), and call it from every top-k entry point, including SearchConfig top-k and Coconut's searchIndexRecent. k == n keeps working, and the limit follows streaming inserts.

Add C++ and Python tests covering every algorithm built by default.

FrancescaDelGaudio and others added 3 commits November 11, 2026 11:46
Messi, Sofa, Fresh and Sing padded missing top-k slots by repeating the
last neighbor; ParIS, Coconut and Hercules returned placeholder ids; and
BruteForce, LbBruteforce, DumpyOS and Odyssey only printed an error and
returned without writing results.

Add SimilaritySearchAlgorithm::checkTopKNotGreaterThanDatabase, which
throws std::invalid_argument (ValueError in Python), and call it from
every top-k entry point, including SearchConfig top-k and Coconut's
searchIndexRecent. k == n keeps working, and the limit follows streaming
inserts.

Add C++ and Python tests covering every algorithm built by default.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
ubuntu-latest moved to Ubuntu 26.04 (image 20261101), and auditwheel
refuses to repair a wheel built with that toolchain into a manylinux
tag ("too-recent versioned symbols"). The last green release dry-run
ran on ubuntu-24.04. Pin both the dry-run and the PyPI publish job so
the next release builds a publishable wheel.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
On ubuntu-latest, now Ubuntu 26.04, nine HerculesRange RandomWalk tests
and CoconutTest.QueryBoundLookupMatchesReferenceAndPrunesSafely fail,
while the same tests pass on ubuntu-24.04 (last green run: 290/290).
None of them exercise code changed on this branch. Pin ci and simple-ci
like the release workflows so CI is green again; the 26.04 failures
need a separate fix.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@FrancescaDelGaudio
FrancescaDelGaudio merged commit 5419bf5 into main Nov 11, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant